package tokens

import (
	"strconv"

	"github.com/astaxie/beego/context"
)

type tokenParser struct {
}

func (t *tokenParser) GetUid(ctx *context.Context) int {
	uid, _ := strconv.Atoi(ctx.GetCookie("uid"))
	return uid
}

func (t *tokenParser) GetToken(ctx *context.Context) string {
	token := ctx.GetCookie("token")
	return token
}
